Skip to content

Develop - #4484

Open
olenka-tech wants to merge 2 commits into
mate-academy:masterfrom
olenka-tech:develop
Open

Develop#4484
olenka-tech wants to merge 2 commits into
mate-academy:masterfrom
olenka-tech:develop

Conversation

@olenka-tech

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

I am requesting changes because there is a critical blocker in the bite logic that violates the task requirements. In src/herbivoresAndCarnivores.js lines 27–28, the bite method only checks herbivore.hidden === false and does not verify the target is actually a Herbivore. The requirement states the bite should not work on other carnivores, so relying on hidden being undefined is incorrect and could allow biting non-Herbivore objects with hidden: false.

Please fix the bite condition to explicitly ensure the target is a Herbivore and not hidden within a single if, for example: if (herbivore instanceof Herbivore && herbivore.hidden === false) { ... }. This aligns with the requirement to prevent carnivores biting other carnivores and addresses [CHECKLIST ITEM #1 guidance about clear conditions]. Also ensure health reduction by 50 and any death handling logic integrates with Animal.alive if applicable.

What you did well: using filter where appropriate and implementing hide to set hidden = true without toggling. After adding the instanceof Herbivore check and verifying death removal behavior, this should meet the core requirements. Keep it up—this is a small, targeted fix to make your solution robust.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

@olenka-tech
olenka-tech changed the base branch from develop to master August 15, 2026 17:50

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

@olenka-tech olenka-tech mentioned this pull request Aug 15, 2026
Address review feedback: bite() relied on `hidden` being undefined for
carnivores, which would also let any object with `hidden: false` be
bitten. Make the type check explicit with `instanceof Herbivore`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your solution correctly implements all required functionality. The Animal base class properly initializes health (default 100) and name, Herbivore extends Animal with a working hide method, and Carnivore's bite method correctly checks both instanceof Herbivore and hidden === false status before reducing health by 50. The implementation uses filter to remove dead animals from the Animal.alive array as specified. All checklist items are satisfied and no issues were found.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants